const { Controller } = require("egg");

const { getReqParams, getResBody, getResList, getPageParams } = require("../../utils");
const validRules = require("../../utils/valid/rules");

const tableName = "system_notice";
module.exports = class TopicController extends Controller {
  // 未读
  async unread() {
    const { ctx, service } = this;
    const rules = {};
    const params = getReqParams(ctx, rules);
    if (!params) return;
    const data = await service.common.countTotal(tableName, { where: { is_read: 0 } });
    ctx.body = getResBody({ data: data });
  }
};
